<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加雇员信息</title>
</head>
<body>
<div style="width: 500px; margin-left:auto;margin-right:auto;">
	<h3>添加雇员信息</h3>
	<form id="form01" action='<s:url value="/emp/add.htm"/>' method="post">
		<input name="emp.id" placeholder="ID"/><br/>
		<input name="emp.name" placeholder="姓名"/><br/>
		<input name="emp.job" placeholder="职位"/><br/>
		<input name="emp.salary" placeholder="薪金"/><br/>
		<input type="submit" value="添加"/>
		<input type="reset" value="重置"/>
	</form>
	
	<hr/>
	<h3>测试@RequestParam</h3>
	<form id="form02" action='<s:url value="/emp/testParam.htm"/>' method="get">
		<input name="name" placeholder="Name"/><br/>
		<input type="submit" value="提交"/>
		<input type="reset" value="重置"/>
	</form>
	
	<hr/>
	<h3>测试Model</h3>
	<form id="form03" action='<s:url value="/emp/testModel.htm"/>' method="get">
		<input name="name" placeholder="Name"/><br/>
		<input type="submit" value="提交"/>
		<input type="reset" value="重置"/>
	</form>
	
	<hr/>
	<h3>带有路径变量的请求</h3>
	<form id="form03" action='<s:url value="/emp/testPath.htm"/>' method="get">
		<input name="name" placeholder="Name" disabled="disabled"/><br/>
		<input type="submit" value="提交" disabled="disabled"/>
		<input type="reset" value="重置"/>
	</form>
	
	<hr/>
	<h3>Ajax JSON</h3>
	<button id="buttonAjax">Ajax返回</button>
	
	<hr/>
	<h3>文件上传测试</h3>
	<form id="form05" action='<s:url value="/emp/testUpload.json"/>' enctype="multipart/form-data" method="post">
		<input name="file" placeholder="file" type="file"/><br/>
		<input type="submit" value="提交"/>
		<input type="reset" value="重置"/>
	</form>
	
</div>
<script type="text/javascript" src='<s:url value="/resources/js/common/jquery-1.8.0.min.js"/>' ></script>
<script type="text/javascript">
$('#buttonAjax').click(function() {
	$.ajax({
        type: "post",
        url: "query.json",
        data: {deptNo:20},
        dataType: "json",
        success: function(data){
                    alert('success');
                 }
    });
});
</script>	
</body>
</html>